-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Round calculator values based on order currency #2877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thank you!
|
||
def compute(object) | ||
computed_amount = (object.amount * preferred_flat_percent / 100).round(2) | ||
currency_exponent = ::Money::Currency.find(preferred_currency).exponent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be the currency taken from the order where the calculator lives instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like that better. I'll make the changes.
98c0be6
to
4105e2d
Compare
@kennyadsl this is ready to be looked at again. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Build issues should be fixed by rebasing with master.
4105e2d
to
c027685
Compare
Fixes solidusio#1957 by getting the exponent of the desired currency from Money::Currency
c027685
to
0e08301
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, thanks @ericsaupe!
Thanks @ericsaupe ! |
Fixes #1957 by getting the exponent of the desired currency from
Money::Currency